Potted Plants v2.0

Author: andoreth
Contact: andoreth@earthlink.net or pm at the Morrowind Forums


About this mod:


Players: 

This mod adds a line of potted plants to Ancola's (of Sadrith Mora) shop stall. They are not that expensive (except for hackle-lo), come in nice pots, are completely portable, and will bear an ingredient after the first 10 days, and every 30 days from then on. They are meant to decorate your house, more than anything, and I hope you enjoy them!



Modders (especially scripters):

This mod was not really created in order to add potted plants to Morrowind, but as an exercise in how to "group" objects together, and how to manage separate incarnations of the same "object group" in the game. That's quite a mouthful, so let me go over the script's basic theory.

1.) There is a potted plant. The potted plant is an inventory item (misc) that, when dropped into the game world PlaceAtPc's a plant, and a bit of soil (both activators). Then, when you pick up the pot, the plant and soil are disable/deleted out of the game. When you put the plant back down, a new plant and soil are placed. It (basically) appears that the same potted plant is being placed over and over. 

2.) Now, here's the tricky part. Let's say you buy 2 of the same pot objects (with the same scripts running on the pots) and place them both down. They each place an instance of the same activator object and soil object. How do you make sure that the _correct_ plant and soil objects are deleted when you pick up each pot, and that the others stay?

3.) You do this through the use of a series of global variables. I'm going to list the ones I use in this mod and give a brief description of what they are doing:

jjsPotNum ..... This is increased by 1 each time a pot is placed down, and it's number is transfered to the pot. This number is the "drive" that keeps all instances separate.

jjsPotWhich ....This is the transfer global. It moves the pot's current number to the activator's number. Now the activators are "tied" to the pots by a matching variable.

jjsPotTake ..... Tells everybody to look to see if they are being "called" to action.


4.) So here is what happens: 

4a.) You put down a pot. It adds 1 to jjsPotNum, stores that number into a variable, places the number into jjsPotWhich, and PlaceAtPc's the plant and soil.

4b.) The plant and soil both take the value of jjsPotWhich and store it in a variable.

4.c.) You pick up the plant. The plant takes it's stored variable and puts that into jjsPotWhich, then sets jjsPotTake to 1.  All of the plants and soil check to see if their variable equals jjsPotWhich, and disable/delete themselves if they do.


I've thrown in a bonus for good measure: if you pick the plant, it sends that information out and all of the pots check to see if they have the plant's number. If so, they reset the time until the plant can be picked again.

Well, I hoped that made some kind of sense. I tried to write the scripts as clearly as possible. I don't guarantee that everyone will find a use for this information, but I'm pretty sure it will help someone. ;)



.esp guild

MO - use if you do not have any expansions
TR - use if you have Tribunal, but not Bloodmoon
BM - use if you have Bloodmoon, but not Tribunal
TR & BM - use if you have both

Installation: 

Open the zip and place the proper .esp and all folders (unopened) into the Bethesda/Morrowind/Data Files folder. You should find the icons at Morrowind/DataFiles/Icons/jjs, the textures at Morrowind/Data Files/Textures/jjs, and the meshes at Morrowind/Data Files/Meshes/jjs/achemy (sic).



Everyone, please contact me with any feedback!